import request from '@/utils/request'
import type { ResponseData } from '@/types/common'

interface LoginData {
  username: string
  password: string
}

interface RegisterData extends LoginData {
  confirmPassword: string
}

export const login = (data: LoginData) => {
  return request.post<ResponseData>('/auth/login', data)
}

export const register = (data: RegisterData) => {
  return request.post<ResponseData>('/auth/register', data)
}
